<?php
/**
 * Created by PhpStorm.
 * User: liang
 * Date: 2022/08/16
 * Time: 10:45
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class UnicomOrder extends Model
{
    use HasFactory;

    protected $table = 'sp_unicom_order';
    protected $primaryKey = 'id';
    public $timestamps = false;
    
    //联通卡状态
    const UNICOM_STATUS_ONE = 1;//已同步
    const UNICOM_STATUS_TWO = 2;//未同步
    const UNICOM_STATUS_THREE = 3;//已关闭
    
    protected function getUnicomList($pageSize,$where){
        $select = array('id', 'order_id', 'create_time', 'goodsId', 'certId', 'certName', 'mobile', 'phoneNum', 'status', 'result', 'status_2', 'status_3', 'status_4','remark','orderId');
        $data = $this
            ->select($select)
            ->where($where)
            ->orderBy('create_time', 'desc')
            ->paginate($pageSize);
        $data = $data ? $data->toArray() : [];
        return $data;
    }
    
}
